package com.mingke.chat.message.request;

import com.mingke.chat.message.logic.EasyChatReportInfoLogic;
import com.mingke.chat.server.EasyChatClientChannelTool;

import java.nio.channels.AsynchronousSocketChannel;

/**
 * @author mingke
 * @function 客户端上报消息
 * @date 2021/12/20
 */
public class EasyChatReportInfo extends EasyChatRequest {
    /** 用户的number*/
    private Integer number;
    /** 用户的认证token*/
    //private String token;
    /**
     * 每个消息都必须要去实现的处理消息方法
     */
    @Override
    public void handlerMessage(AsynchronousSocketChannel socketChannel) {
        //将信道加入到map当中备用
        EasyChatClientChannelTool.instance.addChannel(number, socketChannel);
        //收到消息上报表示用户已经上线，在需要去修改
        EasyChatReportInfoLogic logic = new EasyChatReportInfoLogic();
        logic.doLogic(this);
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public EasyChatReportInfo() {
    }

    public EasyChatReportInfo(Integer number){
        this.number = number;
    }
}
